package org.xjl.model.provider.config;

import dev.langchain4j.model.openai.OpenAiChatModel;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@RequiredArgsConstructor
public class ModelConfig {

    private final DeepSeekModelProperties deepSeekModelProperties;
    private final QwenModelProperties qwenModelProperties;

    @Bean
    public OpenAiChatModel deepSeekModel() {
        return OpenAiChatModel.builder()
                .apiKey(deepSeekModelProperties.getApiKey())
                .modelName(deepSeekModelProperties.getModelName())
                .baseUrl(deepSeekModelProperties.getEndpoint())
                .logRequests(deepSeekModelProperties.getLogRequests())
                .logResponses(deepSeekModelProperties.getLogResponses())
                .build();
    }

    @Bean
    public OpenAiChatModel qwenModel() {
        return OpenAiChatModel.builder()
                .apiKey(qwenModelProperties.getApiKey())
                .modelName(qwenModelProperties.getModelName())
                .baseUrl(qwenModelProperties.getEndpoint())
                .logRequests(qwenModelProperties.getLogRequests())
                .logResponses(qwenModelProperties.getLogResponses())
                .build();
    }
}
